import request from '@/utils/request_1'

// 新增盘点单
export const addCheck = (params: any) =>
  request({
    url: '/check',
    method: 'post',
    data: { ...params }
  })

// 修改盘点单
export const updateCheck = (params: any) =>
  request({
    url: '/check',
    method: 'put',
    data: { ...params }
  })

// 删除盘点单
export const deleteCheck = (params: any) =>
  request({
    url: '/check',
    method: 'delete',
    params
  })

// 取消盘点单
export const cancleCheck = (params: any) =>
  request({
    url: '/check/cancel',
    method: 'put',
    data: { ...params }
  })

// 查询详情
export const getCheckDetail = (params: any) =>
  request({
    url: `/check/detail/${params}`,
    method: 'get',
    params
  })

// 查询全部盘点单
export const getAllCheck = (params: any) =>
  request({
    url: '/check/list',
    method: 'get',
    params
  })

// 盘点单表格分页查询
export const getcheckPaging = (params: any) =>
  request({
    url: '/check/page',
    method: 'get',
    params
  })

// 分页查询盘点单明细
export const getCheckDetailPaging = (params: any) =>
  request({
    url: '/check/pageDetail',
    method: 'get',
    params
  })

// 生成盘点任务
export const generateCheckTask = (params: any) =>
  request({
    url: '/check/task',
    method: 'post',
    data: params
  })

// 查询盘点单
export const getCheck = (params: any) =>
  request({
    url: `/check/${params}`,
    method: 'get',
    params
  })
